import { defineStore } from "pinia";

const useFlowStore = defineStore("flow", () => {
  const id = ref(null);
  const flowName = ref(null);
  const flowCode = ref(null);
  const flowWidgets = ref([])
  const nodeIds = ref([]);
  const nodeList = ref([]);
  const nodeConfig = ref({});
  const flowGroup = ref(null);
  const flowIcon = ref('ceshiliucheng.png');
  const description = ref(null);
  function reset() {
    id.value = null;
    flowName.value = null;
    flowCode.value = null;
    flowWidgets.value = []
    nodeIds.value = []
    nodeList.value = []
    nodeConfig.value = {}
    flowGroup.value = null;
    flowIcon.value = 'ceshiliucheng.png';
    description.value = null;
  }
  return { id, flowName, flowIcon, flowCode, flowWidgets, nodeIds, nodeConfig, flowGroup, description, reset };
});

export default useFlowStore;
